﻿using System.Collections.Generic;
using System.Linq;
using LINQtoFxCop.Core;

namespace LINQtoFxCop.Flaws.Naming
{
  internal class NamingInterfaceNameShouldStartWithI : FlawsIntrospectionRule
  {
    public NamingInterfaceNameShouldStartWithI()
      : base("NamingInterfaceNameShouldStartWithI")
    { }

    protected override IEnumerable<QueryResult> Query()
    {
      return
        from @interface in Interfaces
        where !@interface.Name.Name.StartsWith("I")
        select Result(@interface);
    }
  }
}